﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Web;

namespace UncleBobWebService.Models
{
    [DataContract] 
    public class JobApplication
    {
        [DataMember]
        public JobModel Job { get; set; }

        [DataMember]
        public DateTime ApplyDate { get; set; }

        [DataMember]
        public bool Reviewed { get; set; }

        [DataMember]
        public bool Approved { get; set; }

        [DataMember]
        public bool Hired { get; set; }

        [DataMember]
        public int UserID { get; set; }

        [DataMember]
        public bool Rejected { get; set; }

        [DataMember]
        public int AppID { get; set; }

        [DataMember]
        public CommentModel CommentContainer { get; set; }

        [DataMember]
        public string Status
        {
            get
            {
                if (Rejected)
                    return "Rejected";
                if (!Reviewed & !Approved & !Hired)
                    return "Pending Review";
                if (Reviewed & !Approved & !Hired)
                    return "Pending Approval";
                if (Reviewed & Approved & !Hired)
                    return "Approved";
                if (Hired)
                    return "Hired";
                return "In Transfer";
            }
            set
            {
            }
        }

        public JobApplication()
        {
            Job = new JobModel();
            ApplyDate = DateTime.MinValue;
            CommentContainer = new CommentModel();
        }

        [DataMember]
        public string Comment { get; set; }
    }
}
